import sys
import os

from PySide6.QtWidgets import QApplication

from qt_material import apply_stylesheet
from page.home import MainWindow

if __name__ == "__main__":
    # 确保可以找到资源文件
    base_dir = os.path.dirname(os.path.abspath(__file__))

    app = QApplication(sys.argv)

    # 设置应用图标
    # app.setWindowIcon(QIcon(os.path.join(base_dir, "assets", "icon.png")))

    # 创建主窗口
    window = MainWindow()

    # 应用材料设计主题
    apply_stylesheet(app, theme='dark_teal.xml')

    # 显示窗口
    window.show()

    # 运行应用
    sys.exit(app.exec())
